package com.lc.springboot.service.impl;

import com.lc.springboot.mapper.UserMapper;
import com.lc.springboot.model.User;
import com.lc.springboot.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author lengchuan <lishuijun1992@gmail.com>
 * @date 16-8-24
 */
@Service
@Transactional
public class UserServiceImpl implements IUserService{

    @Autowired
    private UserMapper userMapper;


    public int addUser(User user) {
        return userMapper.saveUser(user);
    }

    public User getUserById(int id) {
        return userMapper.selectUserById(id);
    }

    public void deleteUserById(int id) {
        userMapper.deletUserById(id);
    }

    public int updateUser(User user) {
        return userMapper.updateUser(user);
    }

    public List<User> getusers() {
        return null;
    }
}
